﻿using System;
using System.Collections.Generic;
using System.Text;
using HR60_PanelSoft.View.Base;

namespace HR60_PanelSoft.View.Controls
{
	// 横向充满父控件的层，用于避免换行
	public class DivPanel : System.Windows.Forms.FlowLayoutPanel
	{
		public DivPanel()
		{
			this.Height = 36;
			this.Margin = new System.Windows.Forms.Padding(0);
			this.ParentChanged += new EventHandler(FormLine_ParentChanged);
		}

		void FormLine_ParentChanged(object sender, EventArgs e)
		{
			if (this.Parent == null) return;
			this.Width = Parent.Width;
			this.Parent.SizeChanged += new EventHandler(Parent_SizeChanged);
		}

		void Parent_SizeChanged(object sender, EventArgs e)
		{
			if (this.Parent == null) return;
			this.Width = Parent.Width;
		}
	}
}
